﻿@model OneoneNine.ViewModels.UserEditViewModel
@{
    ViewBag.Title = "编辑用户";
}

<h2>@ViewBag.Title</h2>

<form method="post">

    <div class="form-group row">
        <label asp-for="UserName" class="col-sm-2"></label>
        <div class="col-sm-10">
            <input class="form-control" asp-for="UserName">
            <span class="invalid" asp-validation-for="UserName"></span>
        </div>
    </div>

    <div class="form-group row">
        <label asp-for="Email" class="col-sm-2"></label>
        <div class="col-sm-10">
            <input class="form-control" asp-for="Email">
            <span class="invalid" asp-validation-for="Email"></span>
        </div>
    </div>

    <div class="invalid" asp-validation-summary="ModelOnly">
    </div>

    <button type="submit" class="btn btn-primary">保存</button>
    <a asp-action="Index" class="btn btn-secondary">返回列表</a>
</form>

<hr />

<h3>用户的Claims</h3>

<ul>
    @foreach (var claim in Model.Claims)
    {
        <li>
            @claim
            <form asp-action="RemoveClaim" asp-route-id="@Model.Id" asp-route-claim="@claim" method="post">
                <button type="submit" class="close" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </form>
        </li>
    }
</ul>

<a asp-action="ManageClaims" asp-route-id="@Model.Id" class="btn btn-primary">管理用户的Claims</a>